package com.aidex.biz.service.impl;

import java.util.List;
import com.aidex.common.annotation.DataScope;
import com.github.pagehelper.PageInfo;
import com.aidex.common.core.domain.entity.SysUser;
import com.aidex.common.core.domain.entity.SysDept;
import com.aidex.common.core.service.BaseServiceImpl;
import com.aidex.framework.cache.DeptUtils;
import com.aidex.framework.cache.UserUtils;
import org.springframework.stereotype.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.aidex.biz.mapper.FriendLinkMapper;
import com.aidex.biz.domain.FriendLink;
import com.aidex.biz.service.FriendLinkService;
import org.springframework.transaction.annotation.Transactional;
import com.aidex.common.utils.NumberUtils;

/**
 * 友情链接Service业务层处理
 * @author sean
 * @email 2074844820@qq.com
 * @date 2025-04-11
 */
@Service
@Transactional(readOnly = true)
public class FriendLinkServiceImpl extends BaseServiceImpl<FriendLinkMapper, FriendLink> implements FriendLinkService
{
    private static final Logger log = LoggerFactory.getLogger(FriendLinkServiceImpl.class);

    /**
     * 获取单条数据
     * @param friendLink 友情链接
     * @return 友情链接
     */
    @Override
    public FriendLink get(FriendLink friendLink)
    {
        FriendLink dto = super.get(friendLink);
        return dto;
    }

    /**
     * 获取单条数据
     * @param id 友情链接id
     * @return 友情链接
     */
    @Override
    public FriendLink get(String id)
    {
        FriendLink dto = super.get(id);
        return dto;
    }


    /**
     * 查询友情链接列表
     * @param friendLink 友情链接
     * @return 友情链接
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public List<FriendLink> findList(FriendLink friendLink)
    {
        return super.findList(friendLink);
    }

    /**
     * 分页查询友情链接列表
     * @param friendLink 友情链接
     * @return 友情链接
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public PageInfo<FriendLink> findPage(FriendLink friendLink)
    {
        return super.findPage(friendLink);
    }

    /**
     * 保存友情链接
     * @param friendLink
     * @return 结果
     */
    @Override
    public boolean save(FriendLink friendLink)
    {
        return super.save(friendLink);
    }


    /**
     * 删除友情链接信息
     * @param friendLink
     * @return 结果
     */
    @Override
    public boolean remove(FriendLink friendLink)
    {
        return super.remove(friendLink);
    }

    /**
     * 批量删除友情链接
     * @param ids 需要删除的友情链接ID
     * @return 结果
     */
    @Transactional(readOnly = false)
    @Override
    public int deleteFriendLinkByIds(String[] ids)
    {
        return mapper.deleteFriendLinkByIds(ids);
    }

    /**
     * 获取最大编号
     * @param friendLink 友情链接
     * @return 结果
     */
    @Override
    public int findMaxSort(FriendLink friendLink)
    {
        return NumberUtils.nextOrder(mapper.findMaxSort(friendLink));
    }
}
